<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<ui:composition template="../template/layout.xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets">
	<ui:param name="pageHeaderTitle" value="Create treatment request" />
	<ui:param name="pageTitle" value="Create treatment request" />
	<ui:define name="content">
		<div id="inner_content">
			<h:form>
				<h:panelGrid columns="3" cellpadding="8" style="margin-top: 40px; table-layout: fixed" columnClasses="createRequestGridColumn1, createRequestGridColumn2, createRequestGridColumn3">
					
					<h:panelGroup>
						<p:outputLabel value="Meet date " for="meetDate" />
						<br />
						<p:calendar value="#{createTreatmentRequestBean.treatmentRequest.meetDate}" readonly="#{facesContext.renderResponse}" pattern="MM/dd/yyyy" 
							id="meetDate" showOn="button" styleClass="pCalendar" converter="stringToCalendarConverterNoTime" mindate="c"  >
							<f:param name="cid" value="#{javax.enterprise.context.conversation.id}"/>
							<p:ajax event="dateSelect" process="@this" />							
						</p:calendar>
						<br />
					</h:panelGroup>										
					
					<h:panelGroup>						
					</h:panelGroup>
					
					<h:panelGroup>
						<br />
						<p:message for="meetDate" />
					</h:panelGroup>
					
					<h:panelGroup>
						<p:outputLabel value="Meet hour " for="meetHour" /><p:outputLabel value="minutes " for="meetMinute" style="margin-left: 34px" />						
						<br />
						<p:selectOneMenu id="meetHour" panelStyle="width:100px"
							style="width:110px" value="#{createTreatmentRequestBean.selectedHour}">				
							<f:selectItems value="#{createTreatmentRequestBean.hourList}" />
							<f:param name="cid" value="#{javax.enterprise.context.conversation.id}"/>
							<p:ajax event="change" process="@this" />
						</p:selectOneMenu>												
						<p:selectOneMenu id="meetMinute" panelStyle="width:100px"
							style="width:110px; margin-left:10px" value="#{createTreatmentRequestBean.selectedMinute}">				
							<f:selectItems value="#{createTreatmentRequestBean.minuteList}" />
							<f:param name="cid" value="#{javax.enterprise.context.conversation.id}"/>
							<p:ajax event="change" process="@this" />
						</p:selectOneMenu>
					</h:panelGroup>
					
					<h:panelGroup>						
					</h:panelGroup>
					
					<h:panelGroup>
					</h:panelGroup>
					
					<h:panelGroup>					
						<p:outputLabel value="Doctor " for="selectDoctor" />
						<br />
						<p:inputText id="selectDoctor" readonly="#{facesContext.renderResponse}" value="#{createTreatmentRequestBean.doctorName}" />																				
					</h:panelGroup>
					
					<h:panelGroup>
						<br />
						<h:outputLink value="selectDoctor.xhtml">
						<h:outputText value="Select doctor"/>
							<f:param name="cid" value="#{javax.enterprise.context.conversation.id}"/>
						</h:outputLink>
					</h:panelGroup>
					
					<h:panelGroup>
						<br />
						<p:message for="selectDoctor" />
					</h:panelGroup>									

					<h:panelGroup>
						<br />
						<p:commandButton value="Submit"
							action="#{createTreatmentRequestBean.createTreatmentRequest()}"
							styleClass="pCommandButton" ajax="false" />
					</h:panelGroup>	
				<input type="hidden" name="actId" value="#{createTreatmentRequestBean.actId}" /> 													
				</h:panelGrid>
			</h:form>
		</div>
	</ui:define>
<ui:define name="footer">	
	<ui:param name="navBean" value="#{createTreatmentRequestBean}" />
	<ui:param name="navAction" value="goBack" />
	<ui:param name="navTitle" value="Back" />
	<ui:include src="/template/footer_bean_navigation.xhtml" />
</ui:define>
</ui:composition>
</html>